"==============================================================================
" vim 内置配置 
"==============================================================================

" 设置 vimrc 修改保存后立刻生效，不用在重新打开
" 建议配置完成后将这个关闭
autocmd BufWritePost $MYVIMRC source $MYVIMRC
" 设置编码
set encoding=utf8
" 字体
" set guifont=DroidSansMono\ Nerd\ Font\ 11
" 关闭兼容模式
set nocompatible
set nu " 设置行号
set cursorline "突出显示当前行
" set cursorcolumn " 突出显示当前列
" 显示相对行号
set relativenumber
" 取消相对行号
"set norelativenumber

set showmatch " 显示括号匹配

" tab 缩进
set tabstop=4 " 设置Tab长度为4空格
set shiftwidth=4 " 设置自动缩进长度为4空格
set autoindent " 继承前一行的缩进方式，适用于多行注释
" 设置空白字符的视觉提示
set list listchars=extends:❯,precedes:❮,tab:▸\ ,trail:˽

" 定义快捷键的前缀，即<Leader>
let mapleader=" " 


" ==== 系统剪切板复制粘贴 ====
" v 模式下复制内容到系统剪切板
vmap <Leader>c "+yy
" n 模式下复制一行到系统剪切板
nmap <Leader>c "+yy
" n 模式下粘贴系统剪切板的内容
nmap <Leader>v "+p

" 开启实时搜索
set incsearch
" 搜索时大小写不敏感
set ignorecase
syntax enable
syntax on                    " 开启文件类型侦测
filetype plugin indent on    " 启用自动补全

" 退出插入模式指定类型的文件自动保存
au InsertLeave *.go,*.sh,*.java write

"==============================================================================
" 插件开始的位置
"==============================================================================

" 为插件指定一个目录
" - For Neovim: stdpath('data') . '/plugged'
" - Avoid using standard Vim directory names like 'plugin' 避免使用标准的Vim目录名，如'plugin'
call plug#begin('~/.vim/plugged')

" 确保使用单引号

" 可以快速对齐的插件;  简化符号Shorthand notation; 获取fetches https://github.com/junegunn/vim-easy-align
Plug 'junegunn/vim-easy-align'

" 自动补全括号的插件，包括小括号，中括号，以及花括号
Plug 'jiangmiao/auto-pairs'

" Any valid git URL is allowed 允许任何有效的git URL
Plug 'https://github.com/junegunn/vim-github-dashboard.git'

" Multiple Plug commands can be written in a single line using | separators 使用|分隔符可以在一行中编写多个插头命令
" Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'

" Vim状态栏插件，包括显示行号，列号，文件类型，文件名，以及Git状态
Plug 'vim-airline/vim-airline'

" 代码自动完成，安装完插件还需要额外配置才可以使用
"Plug 'Valloric/YouCompleteMe'
" 赵启明大佬 nodejs 写的补全插件
Plug 'neoclide/coc.nvim', {'branch': 'release'}
" 异步的错误处理的插件
Plug 'dense-analysis/ale'

" 使用 coc-snippets 替换
" 下面两个插件要配合使用，可以自动生成代码块
" Plug 'SirVer/ultisnips'
" Plug 'honza/vim-snippets'

" 可以在 vim 中使用 tab 补全
"Plug 'vim-scripts/SuperTab'

" 可以在 vim 中自动完成
Plug 'Shougo/neocomplete.vim'

"快速注释
Plug 'preservim/nerdcommenter'


" 用来提供一个导航目录的侧边栏 ; 插件 On-demand loading 按需加载
Plug 'scrooloose/nerdtree', { 'on':  'NERDTreeToggle' }

" 可以使 nerdtree 的 tab 更加友好些
Plug 'jistr/vim-nerdtree-tabs'

" 可以在导航目录中看到 git 版本信息
Plug 'Xuyuanp/nerdtree-git-plugin'

" 给文件添加图标
Plug 'ryanoasis/vim-devicons'
" 与vim-devicons一起使用，为图标或整个标签添加颜色
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'

Plug 'tpope/vim-fireplace', { 'for': 'clojure' }



" 可以在文档中显示 git 信息
Plug 'airblade/vim-gitgutter'

" Using a non-master branch 使用非主分支
Plug 'rdnetto/YCM-Generator', { 'branch': 'stable' }

" 查看当前代码文件中的变量和函数列表的插件，
" 可以切换和跳转到代码中对应的变量和函数的位置
" 大纲式导航, Go 需要 https://github.com/jstemmer/gotags 支持
Plug 'majutsushi/tagbar'

" 使用标记版本;允许通配符(要求git 1.9.2或更高版本)
" Using a tagged release; wildcard allowed (requires git 1.9.2 or above)
Plug 'fatih/vim-go', { 'tag': '*' }

" go 中的代码追踪，输入 gd 就可以自动跳转
Plug 'dgryski/vim-godef'
" 代码自动格式化
Plug 'Chiel92/vim-autoformat'

" Plugin options 插件选项
Plug 'nsf/gocode', { 'tag': 'v.20150303', 'rtp': 'vim' }

"　外部插件 与更新后处理钩
" Plugin outside ~/.vim/plugged with post-update hook
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
" 在浮动窗口中使用neovim终端
Plug 'voldikss/vim-floaterm'
" 内置终端调教
Plug 'skywind3000/vim-terminal-help'

" 非托管插件(手动安装和更新)
" Unmanaged plugin (manually installed and updated)
" Plug '~/my-prototype-plugin'

" yang 语法高亮
Plug 'nathanalderson/yang.vim' "光标下单词高亮
Plug 'itchyny/vim-cursorword'
" 同时高亮多个单词
Plug 'lfv89/vim-interestingwords'

" 文件搜索 fuzzy find files
Plug 'ctrlpvim/ctrlp.vim'
" 模糊搜索当前文件中所有函数
Plug 'tacahiroy/ctrlp-funky'

" 支持快捷键<c-h/j/k/l>在vim和tmux分割之间无缝切换
Plug 'christoomey/vim-tmux-navigator'


" 配色方案
" colorscheme neodark
Plug 'KeitaNakamura/neodark.vim'
" colorscheme monokai
Plug 'crusoexia/vim-monokai'
" colorscheme github
Plug 'acarapetis/vim-colors-github'
" colorscheme one
Plug 'rakr/vim-one'
" colorscheme gruvbox
Plug 'morhetz/gruvbox'
" colorscheme night-owl
Plug 'haishanh/night-owl.vim'

" 插件结束的位置，插件全部放在此行上面
call plug#end()

"==============================================================================
" 主题配色
"==============================================================================

" 开启24bit的颜色，开启这个颜色会更漂亮一些
set termguicolors
" 配色方案, 可以从上面插件安装中的选择一个使用
" colorscheme gruvbox  " 主题

colorscheme night-owl

" To enable the lightline theme
" let g:lightline = { 'colorscheme': 'nightowl' }
set background=dark " 主题背景 dark-深色; light-浅色


""""" enable 24bit true color
" If you have vim >=8.0 or Neovim >= 0.1.5
if (has("termguicolors"))
 set termguicolors
endif
" For Neovim 0.1.3 and 0.1.4
let $NVIM_TUI_ENABLE_TRUE_COLOR=1

"==============================================================================
" Chiel92/vim-autoformat 插件
"==============================================================================
let g:autoformat_verbosemode=1 "开启详细模式便于查错
"设置发生保存事件时执行格式化
autocmd BufWrite *.go,*.c*.py,*.java,*.sh,*.json,*.js,*.html,*.css,*.gradle,*.sql,*.xml :Autoformat 

"let g:autoformat_autoindent = 0
"let g:autoformat_retab = 0
"let g:autoformat_remove_trailing_spaces = 0
"autocmd FileType vim,tex let b:autoformat_autoindent=0
"gg=G :retab :RemoveTrailingSpaces

"==============================================================================
" vim-go 插件
"==============================================================================
let g:go_fmt_command = "goimports" " 格式化将默认的 gofmt 替换
let g:go_autodetect_gopath = 1
let g:go_list_type = "quickfix"

let g:go_version_warning = 1
let g:go_highlight_types = 1
let g:go_highlight_fields = 1
let g:go_highlight_functions = 1
let g:go_highlight_function_calls = 1
let g:go_highlight_operators = 1
let g:go_highlight_extra_types = 1
let g:go_highlight_methods = 1
let g:go_highlight_generate_tags = 1

let g:godef_split=2

"==============================================================================
" NERDTree 插件
"==============================================================================

" 打开和关闭NERDTree快捷键
map <F10> :NERDTreeToggle<CR>
" 显示行号
let NERDTreeShowLineNumbers=1
" 打开文件时是否显示目录
let NERDTreeAutoCenter=1
" 是否显示隐藏文件
let NERDTreeShowHidden=0
" 设置宽度
" let NERDTreeWinSize=31
" 开启Nerdtree时自动显示Bookmarks
" let NERDTreeShowBookmarks=1
" 是否显示行号
"let g:NERDTreeShowLineNumbers=1
" 忽略一下文件的显示
let NERDTreeIgnore=['\.pyc','\~$','\.swp','\.vscode','\.idea','__pycache__']
" 打开 vim 文件及显示书签列表
let NERDTreeShowBookmarks=2
"打开vim时如果没有文件自动打开NERDTree
" autocmd vimenter * if !argc()|NERDTree|endif
"当NERDTree为剩下的唯一窗口时自动关闭
" autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif

" 在终端启动vim时，共享NERDTree
let g:nerdtree_tabs_open_on_console_startup=1

"==============================================================================
"  majutsushi/tagbar 插件
"==============================================================================

" majutsushi/tagbar 插件打开关闭快捷键
nmap <F9> :TagbarToggle<CR>

let g:tagbar_type_go = {
    \ 'ctagstype' : 'go',
    \ 'kinds'     : [
        \ 'p:package',
        \ 'i:imports:1',
        \ 'c:constants',
        \ 'v:variables',
        \ 't:types',
        \ 'n:interfaces',
        \ 'w:fields',
        \ 'e:embedded',
        \ 'm:methods',
        \ 'r:constructor',
        \ 'f:functions'
    \ ],
    \ 'sro' : '.',
    \ 'kind2scope' : {
        \ 't' : 'ctype',
        \ 'n' : 'ntype'
    \ },
    \ 'scope2kind' : {
        \ 'ctype' : 't',
        \ 'ntype' : 'n'
    \ },
    \ 'ctagsbin'  : 'gotags',
    \ 'ctagsargs' : '-sort -silent'
\ }

"==============================================================================
"  nerdtree-git-plugin 插件
"==============================================================================
let g:NERDTreeIndicatorMapCustom = {
    \ "Modified"  : "✹",
    \ "Staged"    : "✚",
    \ "Untracked" : "✭",
    \ "Renamed"   : "➜",
    \ "Unmerged"  : "═",
    \ "Deleted"   : "✖",
    \ "Dirty"     : "✗",
    \ "Clean"     : "✔︎",
    \ 'Ignored'   : '☒',
    \ "Unknown"   : "?"
    \ }

let g:NERDTreeShowIgnoredStatus = 1

"==============================================================================
"  tiagofumo/vim-nerdtree-syntax-highlight 插件
"==============================================================================

let s:brown = "905532"
let s:aqua =  "3AFFDB"
let s:blue = "689FB6"
let s:darkBlue = "44788E"
let s:purple = "834F79"
let s:lightPurple = "834F79"
let s:red = "AE403F"
let s:beige = "F5C06F"
let s:yellow = "F09F17"
let s:orange = "D4843E"
let s:darkOrange = "F16529"
let s:pink = "CB6F6F"
let s:salmon = "EE6E73"
let s:green = "8FAA54"
let s:lightGreen = "31B53E"
let s:white = "FFFFFF"
let s:rspec_red = 'FE405F'
let s:git_orange = 'F54D27'
let g:NERDTreeExtensionHighlightColor = {} " this line is needed to avoid error
let g:NERDTreeExtensionHighlightColor['css'] = s:blue " sets the color of css files to blue

let g:NERDTreeExactMatchHighlightColor = {} " this line is needed to avoid error
let g:NERDTreeExactMatchHighlightColor['.gitignore'] = s:git_orange " sets the color for .gitignore files

let g:NERDTreePatternMatchHighlightColor = {} " this line is needed to avoid error
let g:NERDTreePatternMatchHighlightColor['.*_spec\.rb$'] = s:rspec_red " sets the color for files ending with _spec.rb

"let g:NERDTreeDisableFileExtensionHighlight = 1
"let g:NERDTreeDisableExactMatchHighlight = 1
"let g:NERDTreeDisablePatternMatchHighlight = 1
let g:NERDTreeFileExtensionHighlightFullName = 1
let g:NERDTreeExactMatchHighlightFullName = 1
let g:NERDTreePatternMatchHighlightFullName = 1
let g:NERDTreeHighlightFolders = 1 " enables folder icon highlighting using exact match
let g:NERDTreeHighlightFoldersFullName = 1 " highlights the folder name
" disabling Cursorline highlight from NERDTree fixed
let g:NERDTreeHighlightCursorline = 0
"==============================================================================
"  Valloric/YouCompleteMe 插件
"==============================================================================

" make YCM compatible with UltiSnips (using supertab)
"let g:ycm_key_list_select_completion = ['<C-n>', '<space>']
"let g:ycm_key_list_previous_completion = ['<C-p>', '<Up>']
"let g:SuperTabDefaultCompletionType = '<C-n>'

" better key bindings for UltiSnipsExpandTrigger
"let g:UltiSnipsExpandTrigger = "<tab>"
"let g:UltiSnipsJumpForwardTrigger = "<tab>"
"let g:UltiSnipsJumpBackwardTrigger = "<s-tab>"


"==============================================================================
"  preservim/nerdcommenter 高效率注释插件
"==============================================================================
" let mapleader="\\" 
" 默认情况下，在注释分隔符之后添加空格
let g:NERDSpaceDelims = 1
" 启用NERDCommenterToggle以检查所有选定的行是否已注释
let g:NERDToggleCheckAllLines = 1
" 注视方式
" ca 切换注释方式 //与 /***/
" cc 注释当前行
" cy 和cc作用相同，区别在于先复制要注释的行
" c 空格 切换注释与非注释
" cu 取消注释
" cA 行尾注释并进入插入模式
" cs 性感块注释
" cm 如果可能的话，用多个分隔符来注释给出的行
" ci 分开切换选定行的注释状态，每一个选定行如果被注释了，那么取消注释，反之亦然
" <leader> c$ 注释当前行从光标到行尾
" [count]<leader>cl
" [count]<leader>cb
" [count] <leader>cb
" 和cc作用相同，区别在于分隔符左对齐（cl），右对齐（cr），中间对齐（cb）
" normal 6,cs 从当前行开始注释6行 

" 重置leader 为空格
" let mapleader=" " 
"==============================================================================
"  dense-analysis/ale异步的错误处理的插件
"==============================================================================
let g:ale_set_highlights = 1
let g:ale_set_quickfix = 1
"自定义error和warning图标
let g:ale_sign_error = '✗'
let g:ale_sign_warning = ''
"在vim自带的状态栏中整合ale
let g:ale_statusline_format = ['✗ %d', ' %d', '✔ OK']
"显示Linter名称,出错或警告等相关信息
let g:ale_echo_msg_error_str = 'E'
let g:ale_echo_msg_warning_str = 'W'
let g:ale_echo_msg_format = '[%linter%] %s [%severity%]'
"打开文件时不进行检查
let g:ale_lint_on_enter = 1

"普通模式下，sp前往上一个错误或警告，sn前往下一个错误或警告
nmap sp <Plug>(ale_previous_wrap)
nmap sn <Plug>(ale_next_wrap)
"<Leader>s触发/关闭语法检查
" nmap <Leader>l :ALEToggle<CR>
"<Leader>d查看错误或警告的详细信息
nmap <Leader>d :ALEDetail<CR>
let g:ale_linters = {
    \ 'go': ['golint', 'go vet', 'go fmt'],
    \ }

"==============================================================================
"  neoclide/coc.nvim自动补全插件
"==============================================================================

" TextEdit might fail if hidden is not set.
set hidden

" Some servers have issues with backup files, see #649.
set nobackup
set nowritebackup

" Give more space for displaying messages.
set cmdheight=2

" Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable
" delays and poor user experience.
set updatetime=300

" Don't pass messages to |ins-completion-menu|.
set shortmess+=c

" Always show the signcolumn, otherwise it would shift the text each time
" diagnostics appear/become resolved.
if has("patch-8.1.1564")
  " Recently vim can merge signcolumn and number column into one
  set signcolumn=number
else
  set signcolumn=yes
endif

" Use tab for trigger completion with characters ahead and navigate.
" NOTE: Use command ':verbose imap <tab>' to make sure tab is not mapped by
" other plugin before putting this into your config.
inoremap <silent><expr> <TAB>
      \ pumvisible() ? "\<C-n>" :
      \ <SID>check_back_space() ? "\<TAB>" :
      \ coc#refresh()
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"

function! s:check_back_space() abort
  let col = col('.') - 1
  return !col || getline('.')[col - 1]  =~# '\s'
endfunction

" Use <c-space> to trigger completion.
inoremap <silent><expr> <c-space> coc#refresh()

" Use <cr> to confirm completion, `<C-g>u` means break undo chain at current
" position. Coc only does snippet and additional edit on confirm.
" <cr> could be remapped by other vim plugin, try `:verbose imap <CR>`.
if exists('*complete_info')
  inoremap <expr> <cr> complete_info()["selected"] != "-1" ? "\<C-y>" : "\<C-g>u\<CR>"
else
  inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
endif

" Use `[g` and `]g` to navigate diagnostics
" Use `:CocDiagnostics` to get all diagnostics of current buffer in location list.
nmap <silent> [g <Plug>(coc-diagnostic-prev)
nmap <silent> ]g <Plug>(coc-diagnostic-next)

" GoTo code navigation.
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)

" Use K to show documentation in preview window.
nnoremap <silent> K :call <SID>show_documentation()<CR>

function! s:show_documentation()
  if (index(['vim','help'], &filetype) >= 0)
    execute 'h '.expand('<cword>')
  else
    call CocAction('doHover')
  endif
endfunction

" Highlight the symbol and its references when holding the cursor.
autocmd CursorHold * silent call CocActionAsync('highlight')

" Symbol renaming.
nmap <leader>rn <Plug>(coc-rename)

" Formatting selected code.
xmap <leader>f  <Plug>(coc-format-selected)
nmap <leader>f  <Plug>(coc-format-selected)

augroup mygroup
  autocmd!
  " Setup formatexpr specified filetype(s).
  autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected')
  " Update signature help on jump placeholder.
  autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
augroup end

" Applying codeAction to the selected region.
" Example: `<leader>aap` for current paragraph
xmap <leader>a  <Plug>(coc-codeaction-selected)
nmap <leader>a  <Plug>(coc-codeaction-selected)

" Remap keys for applying codeAction to the current buffer.
nmap <leader>ac  <Plug>(coc-codeaction)
" Apply AutoFix to problem on the current line.
nmap <leader>qf  <Plug>(coc-fix-current)

" Map function and class text objects
" NOTE: Requires 'textDocument.documentSymbol' support from the language server.
xmap if <Plug>(coc-funcobj-i)
omap if <Plug>(coc-funcobj-i)
xmap af <Plug>(coc-funcobj-a)
omap af <Plug>(coc-funcobj-a)
xmap ic <Plug>(coc-classobj-i)
omap ic <Plug>(coc-classobj-i)
xmap ac <Plug>(coc-classobj-a)
omap ac <Plug>(coc-classobj-a)

" Use CTRL-S for selections ranges.
" Requires 'textDocument/selectionRange' support of LS, ex: coc-tsserver
nmap <silent> <C-s> <Plug>(coc-range-select)
xmap <silent> <C-s> <Plug>(coc-range-select)

" Add `:Format` command to format current buffer.
command! -nargs=0 Format :call CocAction('format')

" Add `:Fold` command to fold current buffer.
command! -nargs=? Fold :call     CocAction('fold', <f-args>)

" Add `:OR` command for organize imports of the current buffer.
command! -nargs=0 OR   :call     CocAction('runCommand', 'editor.action.organizeImport')

" Add (Neo)Vim's native statusline support.
" NOTE: Please see `:h coc-status` for integrations with external plugins that
" provide custom statusline: lightline.vim, vim-airline.
set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')}

" Mappings for CoCList
" Show all diagnostics.
nnoremap <silent><nowait> <space>a  :<C-u>CocList diagnostics<cr>
" Manage extensions.
nnoremap <silent><nowait> <space>e  :<C-u>CocList extensions<cr>
" Show commands.
nnoremap <silent><nowait> <space>c  :<C-u>CocList commands<cr>
" Find symbol of current document.
nnoremap <silent><nowait> <space>o  :<C-u>CocList outline<cr>
" Search workspace symbols.
nnoremap <silent><nowait> <space>s  :<C-u>CocList -I symbols<cr>
" Do default action for next item.
nnoremap <silent><nowait> <space>j  :<C-u>CocNext<CR>
" Do default action for previous item.
nnoremap <silent><nowait> <space>k  :<C-u>CocPrev<CR>
" Resume latest coc list.
nnoremap <silent><nowait> <space>p  :<C-u>CocListResume<CR>

"==============================================================================
"  lfv89/vim-interestingwords自动补全插件
"==============================================================================
" <leader>k 高亮单词，n/N 在高亮的单词之间进行跳转
" <leader>K 取消高亮单词

"==============================================================================
"  skywind3000/vim-terminal-help终端调教
"==============================================================================
"
"    ALT + =: toggle terminal below.
"    ALT + SHIFT + h: move to the window on the left.
"    ALT + SHIFT + l: move to the window on the right.
"    ALT + SHIFT + j: move to the window below.
"    ALT + SHIFT + k: move to the window above.
"    ALT + SHIFT + p: move to the previous window.
"    ALT + -: paste register 0 to terminal.
"    ALT + q: switch to terminal normal mode.

"==============================================================================
"   ctrlpvim/ctrlp.vim 文件搜索
"==============================================================================
" <leader>-f			模糊搜索最近打开的文件(MRU)
" <leader>-p			模糊搜索当前目录及其子目录下的所有文件
" 搜索框出来后, 输入关键字, 然后
" ctrl + j/k 进行上下选择
" ctrl + x 在当前窗口水平分屏打开文件
" ctrl + v 同上, 垂直分屏
" ctrl + t 在tab中打开
" 按<F5>清除当前目录的缓存以获取新文件，删除已删除的文件并应用新的忽略选项。
" 按<c-f>和<c-b>在模式之间循环。
" 按此<c-d>键可切换到仅搜索文件名而不是完整路径。
" 按<c-r>切换到正则表达式模式。
" 使用<c-j>，<c-k>或箭头键来浏览结果列表。
" 使用<c-t>或<c-v>，<c-x>在新选项卡或新拆分中打开所选条目。
" 使用<c-n>，<c-p>选择提示历史记录中的下一个/上一个字符串。
" 使用<c-y>创建一个新的文件，它的父目录。
" 使用<c-z>以标记/取消多个文件并<c-o>打开它们。
" 在CtrlP中运行:help ctrlp-mappings或提交?以获取更多映射帮助。
" 提交两个或多个点，..以将目录树上移一个或多个级别。
" 用冒号结束输入字符串，:然后是在打开的文件上执行该命令的命令：:25用于跳至第25行:diffthis。
" 打开多个文件以:diffthis在前四个文件上运行时使用。

"==============================================================================
"  tacahiroy/ctrlp-funky  当前文件函数搜索
"==============================================================================
" 绑定快捷键
" fu 进入当前文件的函数列表搜索
" fU 搜索当前光标下单词对应的函数

nnoremap <Leader>fu :CtrlPFunky<Cr>

" 用光标下的一个词缩小列表的范围 narrow the list down with a word under cursor
nnoremap <Leader>fU :execute 'CtrlPFunky ' . expand('<cword>')<Cr>
" 匹配字符高亮
let g:ctrlp_funky_matchtype = 'path'
" See :h g:ctrlp_funky_matchtype for more details and notes.

" 语法高亮
let g:ctrlp_funky_syntax_highlight = 1


"==============================================================================
"  tchristoomey/vim-tmux-navigator  <c-h/j/k/l> 在vim和tmux分割之间无缝切换
"  无需使用tmux leader 
"==============================================================================
" <ctrl-h> =>左
" <ctrl-j> =>下
" <ctrl-k> =>向上
" <ctrl-l> =>对
" <ctrl-\> =>上一个分屏
"
" 需要在tmux config 文件设置绑定部分

"==============================================================================
"  其他插件配置
"==============================================================================

" markdwon 的快捷键
map <silent> <F5> <Plug>MarkdownPreview
map <silent> <F6> <Plug>StopMarkdownPreview

" tab 标签页切换快捷键
:nn <Leader>1 1gt
:nn <Leader>2 2gt
:nn <Leader>3 3gt
:nn <Leader>4 4gt
:nn <Leader>5 5gt
:nn <Leader>6 6gt
:nn <Leader>7 7gt
:nn <Leader>8 8gt
:nn <Leader>9 8gt
:nn <Leader>0 :tablast<CR>


"set mouse=a     "启用鼠标"
"tmux 与vim配色不一致导致vim失色问题 
"set term=screen
